<template>
  <table>
    <thead>
      <tr>
        <th>ID</th>
        <th>用户名</th>
        <th>姓名</th>
        <th>角色</th>
        <th>启用</th>
        <th>操作</th>
      </tr>
    </thead>
    <tbody>
      <tr v-for="user in users" :key="user.id">
        <td>{{ user.id }}</td>
        <td>{{ user.login }}</td>
        <td>{{ user.name }}</td>
        <td>{{ user.userRole }}</td>
        <td>{{ user.enabled ? '是' : '否' }}</td>
        <td>
          <button @click="$emit('change-password', { user_id: user.id })">修改密码</button>
        </td>
      </tr>
    </tbody>
  </table>
</template>
<script setup lang="ts">
import { defineProps } from 'vue';
const props = defineProps<{ users: any[] }>();
</script> 